<div class="button-warp"> 
    <div class="button" *ngFor="let i of range(sum);let idx=index" [ngClass]="{'active':idx == active}" (click)="changeActive(idx)" ></div>
</div>